package com.cetc28.c4isr.knowledge.service;

import com.cetc28.c4isr.knowledge.bean.Relation;
import com.cetc28.c4isr.knowledge.bean.RelationExample;
import com.cetc28.c4isr.knowledge.mapper.RelationMapper;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RelationService {

    private final RelationMapper relationMapper;

    @Autowired
    public RelationService(RelationMapper relationMapper){
        this.relationMapper = relationMapper;
    }


    public List<Relation> getAllRelation(){
        RelationExample example = new RelationExample();
        RelationExample.Criteria criteria = example.createCriteria();
        criteria.andRSourceIsNotNull();
        List<Relation> rlist = relationMapper.selectByExample(example);
        return rlist;
    }

}
